/**
 * json配置举例，更多配置请看 IConfigSchema
 * @author luguoxiang
 * @date 2022/7/5
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
import { FilterTypeEnum, IConfigSchema, jsonFormat, LgBizSelect, LgBizSelectProps } from '@/soar';
import userApi from '@/pages/system/auth/user/api';

const fieldList: IConfigSchema<any>[] = [
  {
    field: 'type',
    label: '类型',
    dataType: 'dict',
    params: 'LogTypeEnum',
    table: {
      sorter: true,
      width: 100,
    },
  },
  {
    field: 'title',
    label: '操作',
    dataType: 'string',
    table: {
      ellipsis: true,
    },
  },
  {
    field: 'content',
    label: '内容',
    dataType: 'string',
    table: {
      ellipsis: true,
    },
  },
  {
    field: 'path',
    label: '接口路径',
    dataType: 'string',
    table: {
      ellipsis: true,
    },
  },
  {
    field: 'startTime',
    label: '操作时间',
    dataType: 'datetime',
    table: {
      width: 150,
    },
  },
  {
    field: 'duration',
    label: '耗时(ms)',
    dataType: 'number',
    table: {
      sorter: true,
      width: 120,
    },
  },
  {
    field: 'clientType',
    label: '终端类型',
    dataType: 'dict',
    params: 'client-type',
    table: {
      sorter: true,
      width: 120,
    },
    search: {
      searchType: FilterTypeEnum.CUSTOM,
    },
  },
  {
    field: 'clientIp',
    label: 'IP',
    dataType: 'string',
    table: {
      width: 135,
    },
  },
  {
    field: 'traceId',
    label: '链路id',
    dataType: 'string',
    table: false,
  },
  {
    field: 'javaMethod',
    label: 'java方法',
    dataType: 'string',
    table: false,
  },
  {
    field: 'userAgent',
    label: '浏览器信息',
    dataType: 'string',
    table: false,
    search: false,
    detail: {
      colProps: {
        style: 'min-width: 100%;',
      },
    },
  },
  {
    field: 'args',
    label: '入参',
    dataType: 'string',
    table: false,
    detail: {
      colProps: {
        style: 'min-width: 100%;',
      },
    },
  },
  {
    field: 'result',
    label: '出参',
    dataType: 'string',
    table: false,
    detail: {
      colProps: {
        style: 'min-width: 100%;',
      },
    },
  },
  {
    field: 'errorStack',
    label: '异常信息',
    dataType: 'string',
    table: false,
    detail: {
      colProps: {
        style: 'min-width: 100%;',
      },
    },
  },
];

export default fieldList;
